package com.ten.cotroller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.ten.pojo.CarTake;
import com.ten.service.CarTakeService;

@Controller
public class ManagerController {
	@Autowired
	private CarTakeService carTakeService;
	@RequestMapping("/fache")
	public String fache(CarTake car,@RequestParam(value = "start", defaultValue ="0")  Integer start,
			                        @RequestParam(value = "size", defaultValue="10") Integer size,HttpServletRequest req){
		carTakeService.insertCarTake(car);
		Map<String,Integer> map =new HashMap<>();
		map.put("start", start);
		map.put("size", size);
		List<CarTake> result =carTakeService.selectByPage(map);
		req.setAttribute("car", result);
		return "fache_detail";
	}
}
